﻿using Client.Components;
using Client.Components.Icons;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;

namespace Client.Test
{
    /// <summary>
    /// Interaction logic for FrmTest_IconImage.xaml
    /// </summary>
    public partial class FrmTest_IconImage : Window
    {
        public FrmTest_IconImage()
        {
            InitializeComponent();
            this.initUI();
        }

        void initUI()
        {
            IconEnum[] arr = (IconEnum[])Enum.GetValues(typeof(IconEnum));

            int rowIndex = 0;

            
            for (int i = 0; i < arr.Length; )
            {
                for (int colIndex = 0; colIndex < 16; colIndex++)
                {
                    IconEnum iconEnum = arr[i];

                    var toAdd = new Client.Components.IconImage() { Icon = iconEnum };
                    toAdd.ToolTip = iconEnum.ToString();

                    root.Children.Add(toAdd);

                    Grid.SetRow(toAdd, rowIndex);
                    Grid.SetColumn(toAdd, colIndex);

                    i = i + 1;

                    if (i >= arr.Length)
                    { 
                        break;
                    }
                }

                rowIndex = rowIndex + 1;
            }
        }
    }
}
